package com.dwxt.community.service;

import com.dwxt.common.base.YesOrNo;
import com.dwxt.community.dao.*;
import com.dwxt.community.entity.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.stereotype.*;

import java.util.*;

@Service
public class CommunityService {

    @Autowired
    private CommunityMapper communityMapper;

    public List<Community> selectList() {
        CommunityExample example = new CommunityExample();
        example.createCriteria().andIsOnEqualTo(YesOrNo.YES);
        return communityMapper.selectByExample(example);
    }

    public Community selectById(Integer id) {
        return communityMapper.selectByPrimaryKey(id);
    }
}
